<template>
  <h1>用户信息</h1>
  <p>
    <span mx-5>用户名:</span>
    <span>{{ info.username }}</span>
  </p>
  <p>
    <span mx-5>性别:</span>
    <span>{{ info.usersex || "nan" }}</span>
  </p>
  <p>
    <span mx-5>年龄:</span>
    <span>{{ info.userage || "weizhi" }}</span>
  </p>
</template>

<script lang="ts" setup>
import { useUserStore } from "/@/stores/user";
const user = useUserStore();
const router = useRouter();

const info = user.getUserInfo;

if (!info.username) {
  router.push("/login");
}
</script>
